package com.gz.common;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.gz.common.model.*;
import com.gz.utils.StringUtil;
import com.jfinal.kit.StrKit;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;

import java.util.*;

/**
 * Created by gongzhen on 2018/6/2.
 */
public class MessageService {
    private static MessageService service;

    private MessageService() {
    }

    public static MessageService getService() {
        if (service == null) {
            service = new MessageService();
        }
        return service;
    }
    public Page<Message> getMessagePage(int pageNum,int pageSize){
        String orderby="id desc";
        Page<Message> messagePage=Message.dao.paginate(pageNum,pageSize,"select * ","from tb_message  order by "+orderby);
        return messagePage;
    }


}
